{% extends "../main.html" %}

{% block title %}{{ _("Capture Message") }}{% end %}

{% block header %}
<script src="/static/js/libs/terminal.min.js" type="text/javascript"></script>
<script src="/static/js/libs/mousewheel-min.js" type="text/javascript"></script>
<script src="/static/js/pages/missions/captured.js" type="text/javascript"></script>
<link href="/static/css/terminal.css" rel="stylesheet" />
{% end %}

{% block content %}
{% from tornado.options import options %}
<div class="container">
    <br />
    <div class="well">
        <span style="float: right; padding-right: 6px; margin-top: -15px;"><button id="closebutton" type="button" class="close" value="{{ '' if box else flag.box.uuid }}"><h2>×</h2></button></span>
        <h3>
            <i class="fa fa-globe"></i>
            {{ _("Incoming Transmission") }}
        </h3>
        
        {% set message = "" %}
        {% if box and flag %}
            {% set message = str(flag.capture_message + "\n\n" + box.capture_message).strip() %}
        {% elif box %}
            {% set message = box.capture_message %}
        {% else %}
            {% set message = flag.capture_message %}
        {% end %} 
        {% set message = message + "\n\n".join(options.story_signature) %}
        <input id="banking" type="hidden" value="{% if options.banking %}${% end %}" />
        <input id="flag" type="hidden" value="{% if flag %}{{ flag.name }}{% end %}" />
        <input id="capture-message" type="hidden" value="{{ message }}" />
        <input id="reward" type="hidden" value="{% if flag %}{{ reward }}{% end %}" />
        <div class="terminalbg">
            <div class="terminalimage c-glitch" style="background-image: url('{{ options.story_character }}');">
                <div class="terminalimage c-glitch__img" style="background-image: url('{{ options.story_character }}');"></div>
                <div class="terminalimage c-glitch__img" style="background-image: url('{{ options.story_character }}');"></div>
                <div class="terminalimage c-glitch__img" style="background-image: url('{{ options.story_character }}');"></div>
                <div class="terminalimage c-glitch__img" style="background-image: url('{{ options.story_character }}');"></div>
                <div class="terminalimage c-glitch__img" style="background-image: url('{{ options.story_character }}');"></div>
            </div>
            <div class="terminaloverlay">
                <br/>
                <div id="console" class="consoleview"></div>
            </div>
        </div>
    </div>
</div>
{% end %}
